package com.xingzhi.feign;

import com.xingzhi.entity.User;
import com.xingzhi.hystixFallback.HystrixClientFallback;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @ClassName UserFeignClient
 * @DESCRIPTION 使用@FeignClient注解的fallback属性，指定fallback类
 * @Author RuanlinJing
 * @Date 2018/6/21 23:02
 * @Version 1.0
 **/
@FeignClient(name = "microservice-provider-user",fallback = HystrixClientFallback.class)
public interface UserFeignHystrixClient {
    @RequestMapping("/{id}")
    User findByIdFeign(@RequestParam("id") Long id);
}
